<!-- Copyright (c) Microsoft Corporation.
     Licensed under the MIT License. -->

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <title>Set and get settings from the task pane</title>

    <!-- Fabric UI -->
    <link rel="stylesheet" href="https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/office-ui-fabric-core/11.1.0/css/fabric.min.css"/>

    <!-- Office JS API -->
    <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>

    <!-- Local files -->
    <script src="https://davidchesnut.github.io/Office-Add-in-samples/Samples/office-add-in-save-custom-settings/src/taskpane.js" type="text/javascript"></script>

</head>

<body class="ms-bgColor-white ms-Fabric">
    <!-- The following image URL tracks diagnostic data for this sample add-in. Please remove the image tag if you reuse this sample in your own code project. -->
    <img src="https://pnptelemetry.azurewebsites.net/pnp-officeaddins/samples/office-add-in-save-custom-settings-run" />

    <div id="set">
        <h2 class="ms-font-xl">Create a new setting</h2>
        <div class="ms-TextField">
            <label class="ms-Label">Name</label>
            <input id="setName" class="ms-TextField-field" type="text" value="" placeholder="">
        </div>
        <div class="ms-TextField">
            <label class="ms-Label">Value</label>
            <input id="setValue" class="ms-TextField-field" type="text" value="" placeholder="">
        </div>
        <button id="saveSetting" class="ms-Button">
            <span class="ms-Button-label">Create setting</span>
        </button>
    </div>

    <div id="get">
        <h2 class="ms-font-xl">Get a setting</h2>
        <div class="ms-TextField">
            <label class="ms-Label">Name</label>
            <input id="getName" class="ms-TextField-field" type="text" value="" placeholder="">
        </div>
        <button id="getSetting" class="ms-Button">
            <span class="ms-Button-label">Get setting</span>
        </button>
    </div>

    <div id="storageSection">
        <h2 class="ms-font-xl">Storage type</h2>
        <div class="ms-Dropdown" tabindex="0">
          
            <i class="ms-Dropdown-caretDown ms-Icon ms-Icon--ChevronDown"></i>
            <select id="storageOptions" class="ms-Dropdown-select">
                <option value="PropertyBag">Property bag</option>
                <option value="Cookies">Browser cookies</option>
                <option value="LocalStorage">Browser local storage</option>
                <option value="SessionStorage">Browser session storage</option>
                <option value="Document">HTML document div</option>
            </select>
        </div>
    </div>

    <div class="ms-MessageBar">
        <div class="ms-MessageBar-content">
            <div class="ms-MessageBar-icon">
                <i class="ms-Icon ms-Icon--Info"></i>
            </div>
            <div id="bannerText" class="ms-MessageBar-text">
                Try creating a new setting, or getting an existing value.
            </div>
        </div>
    </div>
</body>

</html>